
var path =require('path');
var src=path.resolve(__dirname,'../src');
var glob = require('glob');

module.exports = {
	sourceMap:process.env.NODE_ENV == 'dev' ? 'source-map':'cheap-module-source-map',
	htmlChunks:process.env.NODE_ENV == 'dev' ? ['manifest']:['vendor','commons'],
	devServerOutputPath:"dist",
	cssPublicPath:'../',
    imgOutputPath:"img/",
    cssOutputPath:"css/styles.css",
	getEntry(globPath='./src/**/*.js') {
		 var entries = {},fspath=[],basename, tmp, pathname;
		  glob.sync(globPath).forEach(function(entry) {
		    basename = path.basename(entry, path.extname(entry));
		    tmp = entry.split('/').splice(-3);
		    pathname = tmp.splice(1, 1) + '/' + basename; 
		    entries[pathname] = entry;
		  });
		  return entries
	}
}